package com.example.graduation.entity.pojo;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author Jeffery
 * User实体类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("user")
@ApiModel
public class User implements Serializable {
    @ApiModelProperty(value = "用户ID")
    @TableId(value = "user_id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "用户名字")
    @TableField(value = "user_username")
    private String username;

    @ApiModelProperty(value = "用户密码")
    @TableField(value = "user_password")
    private String password;

    @ApiModelProperty(value = "用户邮箱")
    @TableField(value = "user_email")
    private String email;

    @ApiModelProperty(value = "用户性别 0:女 1:男")
    @TableField(value = "user_gender")
    private int gender;

    @ApiModelProperty(value = "用户激活状态 0:未激活 1:已激活")
    @TableField(value = "user_status")
    private int status;

    @ApiModelProperty(value = "用户创建时间")
    @TableField(value = "user_create_time", fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp createTime;

    @ApiModelProperty(value = "用户修改时间")
    @TableField(value = "user_update_time", fill = FieldFill.INSERT_UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp updateTime;

    @ApiModelProperty(value = "用户version")
    @TableField(value = "user_version")
    private int version;

    @ApiModelProperty(value = "用户逻辑删除 0:未删除 1:已删除")
    @TableField(value = "user_has_deleted")
    private int isDeleted;
}
